﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
#region

using System.Linq;
using System.Web.Mvc;
using BTL.OnlineTestingSocial.Application.Facade;

#endregion

namespace BTL.OnlineTestingSocial.Application.Web.Controllers
{
    public class HeaderController : Controller
    {
        private readonly IOnlineTestingEngineFacade _onlineTestingFacade;
        public HeaderController()
            : this(DependencyResolver.Current.GetService<IOnlineTestingEngineFacade>())
        {
        }

        public HeaderController(IOnlineTestingEngineFacade onlineTestingFacade)
        {
            _onlineTestingFacade = onlineTestingFacade;
        }

        public ActionResult Index()
        {
            return View();
        }

        [ChildActionOnly]
        public PartialViewResult ShowHeader()
        {
            var categories = _onlineTestingFacade.GetCategories().ToList();
            return PartialView("~/Views/Header/pvwMenuHeader.cshtml", categories);
        }

    }
}
